package com.gitee.cashzhang27.test.boot.other.controller;

import com.gitee.cashzhang27.test.boot.other.util.CommonConfig;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Cash Zhang
 * @version v1.0
 * @since 2019/06/14 14:58
 */
@Slf4j
@RestController
@RequestMapping("/filter_demo")
public class FilterController {

  @PostMapping("/register")
  public Map register(@RequestParam("name") String name, @RequestParam("mobile") String mobile) {
    log.info("注册成功");
    Map<String, Object> json = new HashMap<>();
    json.put(CommonConfig.SESSION_ID, UUID.randomUUID().toString().replace("-", ""));
    json.put(CommonConfig.OPERATE_RESULT, true);
    json.put("mobile", mobile);
    return json;
  }

}
